|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectalgalcommand.alpha.GUIHelper
public abstract class GUIHelper
A bunch of useful methods for generating UI components
| Constructor Summary | |
|---|---|
GUIHelper()
|
|
| Method Summary | |
|---|---|
static void |
listenToEventsOf(java.lang.Object l,
javax.swing.JComponent... comps)
Add l as a listener to all JComponents provided
that support various listeners (as determined by the presence of a
add...Listener(ActionListener) method.
Supported Listeners:
ActionListener
ChangeListener
FocusListener
ItemListener
PopupMenuListener
UndoableEditListener
|
static javax.swing.JPanel |
makeEditorPanel(java.lang.String label,
java.lang.Object variable,
java.lang.Object listener)
A convenience method for generating an editor panel for a variable. |
static javax.swing.JFrame |
makeProgressPopup(java.lang.String title,
java.lang.String message,
int startvalue,
int endvalue,
javax.swing.JProgressBar bar)
Convenience method to create a JFrame with a progress bar inside. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GUIHelper()
| Method Detail |
|---|
public static void listenToEventsOf(java.lang.Object l,
javax.swing.JComponent... comps)
l as a listener to all JComponents provided
that support various listeners (as determined by the presence of a
add...Listener(ActionListener) method.
Supported Listeners:
l - A Listener (e.g. ActionListener) that you want to register with the JComponentscomps - A list of JComponents
public static javax.swing.JPanel makeEditorPanel(java.lang.String label,
java.lang.Object variable,
java.lang.Object listener)
JFrame frame = new JFrame();
Double altitude;
frame.getContentPane().add(makeEditorPanel("Mountain Peak Altitude (ft)",
altitude, new ActionListener(){
public void actionPerformed(ActionEvent ae){
this.updateAltitude(((JSpinner)ae.getSource()).getValue());
}
});
frame.pack();
frame.setVisible(true);
label - The label for the variable.variable - An object that will be displayed and editedlistener - A listener to handle events generated by editing the
variable, or null.
variable (e.g. a JSpinner is variable is a
number or a JTextField if variable is a String).
java.lang.IllegalArgumentException - If an appropriate editor for variable
was not found.
public static javax.swing.JFrame makeProgressPopup(java.lang.String title,
java.lang.String message,
int startvalue,
int endvalue,
javax.swing.JProgressBar bar)
endvalue is less than of equal to startvalue,
then the progress bar will be indeterminate.
title - message - startvalue - endvalue - bar - A JProgressBar, which will be configured by this method
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||